import type { UserInfo } from '@vben/types';
// interface UserInfo {};
import { requestClient } from '#/api/request';
export namespace UserApi {
  export interface Router {
    msg: string;
    code: number;
    data: Datum[];
  }

  export interface Datum {
    name: string;
    path: string;
    hidden: boolean;
    redirect: string;
    component: string;
    alwaysShow: boolean;
    meta: Meta;
    children: DatumChild[];
  }

  export interface DatumChild {
    name: string;
    path: string;
    hidden: boolean;
    component: string;
    meta: Meta;
    redirect?: string;
    alwaysShow?: boolean;
    children?: ChildChild[];
  }

  export interface ChildChild {
    name: string;
    path: string;
    hidden: boolean;
    component: string;
    meta: Meta;
  }

  export interface Meta {
    title: string;
    icon: string;
    noCache: boolean;
    link: null;
  }
}
/**
 * 获取用户信息
 */
export async function getUserInfoApi() {
  return requestClient.get<UserInfo>('/getInfo');
}

export async function getUserRouter() {
  return requestClient.get<UserApi.Router>('/getRouters');
}
